﻿using System;
using System.Collections;
using System.Data;
using CE.Database;
/// <summary>
/// Summary description for TAQuoteResultDB
/// </summary>
/// 
namespace CE.TravelInsurance
{
    public class TAQuoteResultDB
    {
        public TAQuoteResultDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(TAQuoteResult taquoteresult)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocTAQuoteResultInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            #region Parameter

            _sPara.Add("@TAInsID", taquoteresult.TAInsId);
            _sPara.Add("@ProviderCompanyID", taquoteresult.TACompanyId);
            _sPara.Add("@PlanName", taquoteresult.PlanName);
            _sPara.Add("@PlanType", taquoteresult.PlanType);
            _sPara.Add("@TripType", taquoteresult.TripType);
            _sPara.Add("@CoverageLevel", taquoteresult.CoverageLevel);
            _sPara.Add("@AnnualPremium", taquoteresult.AnnualPremium);
            _sPara.Add("@DTPD_LessYr70", taquoteresult.DTPD_LessYr70);
            _sPara.Add("@DTPD_AboveYr70", taquoteresult.DTPD_AboveYr70);
            _sPara.Add("@DeathPubTrans", taquoteresult.DeathPubTrans);
            _sPara.Add("@DIPC_LessYr70", taquoteresult.DIPC_LessYr70);
            _sPara.Add("@DIPC_AboveYr70", taquoteresult.DIPC_AboveYr70);
            _sPara.Add("@Bereavement", taquoteresult.Bereavement);
            _sPara.Add("@MedExp_LessYr70", taquoteresult.MedExp_LessYr70);
            _sPara.Add("@MedExp_AboveYr70", taquoteresult.MedExp_AboveYr70);
            _sPara.Add("@EmMedEval", taquoteresult.EmMedEval);
            _sPara.Add("@HospIncome", taquoteresult.HospIncome);
            _sPara.Add("@BCR", taquoteresult.BCR);
            _sPara.Add("@CompassVisit", taquoteresult.CompassVisit);
            _sPara.Add("@ChildCare", taquoteresult.ChildCare);
            _sPara.Add("@PersonalLiability", taquoteresult.PersonalLiability);
            _sPara.Add("@LEWAD", taquoteresult.LEWAD);
            _sPara.Add("@BagPerEffect", taquoteresult.BagPerEffect);
            _sPara.Add("@BagDelay", taquoteresult.BagDelay);
            _sPara.Add("@TravelDoc", taquoteresult.TravelDoc);
            _sPara.Add("@DepositTripCancel", taquoteresult.DepositTripCancel);
            _sPara.Add("@Curtailment", taquoteresult.Curtailment);
            _sPara.Add("@TravelDelay", taquoteresult.TravelDelay);
            _sPara.Add("@MissTravelConnection", taquoteresult.MissTravelConnection);
            _sPara.Add("@TravelOverBook", taquoteresult.TravelOverBook);
            _sPara.Add("@PersonalMoney", taquoteresult.PersonalMoney);
            _sPara.Add("@CreditCardLost", taquoteresult.CreditCardLost);
            _sPara.Add("@FBHCP", taquoteresult.FBHCP);
            _sPara.Add("@ACRR", taquoteresult.ACRR);
            _sPara.Add("@Terrorism", taquoteresult.Terrorism);
            _sPara.Add("@KidnapHostage", taquoteresult.KidnapHostage);
            _sPara.Add("@EmTelCharge", taquoteresult.EmtelCharge);
            _sPara.Add("@DMPB", taquoteresult.DMPB);
            _sPara.Add("@WeddingAppAcc", taquoteresult.WeddingAppAcc);
            _sPara.Add("@Golfer", taquoteresult.Golfer);
            _sPara.Add("@RefCEUserId", taquoteresult.RefCEUserID);
            _sPara.Add("@Status", taquoteresult.Status);
            _sPara.Add("@Ninfo1", taquoteresult.Ninfo1); //PolicyId
            _sPara.Add("@Ninfo2", taquoteresult.Ninfo2); //PromotionId
            _sPara.Add("@Ninfo3", taquoteresult.Ninfo3);
            _sPara.Add("@Ninfo4", taquoteresult.Ninfo4); //HospIncome Max
            _sPara.Add("@Ninfo5", taquoteresult.Ninfo5); //BagDelay Hour
            _sPara.Add("@Ninfo6", taquoteresult.Ninfo6); //BagDelay Max
            _sPara.Add("@Ninfo7", taquoteresult.Ninfo7); //TravelDelay Hour
            _sPara.Add("@Ninfo8", taquoteresult.Ninfo8); //TravelDelay Max
            _sPara.Add("@Info1", taquoteresult.Info1); //hijack hour
            _sPara.Add("@Info2", taquoteresult.Info2); //hijack max rate
            _sPara.Add("@Info3", taquoteresult.Info3); //Closure of Travel Agent
            _sPara.Add("@Info4", taquoteresult.Info4); //Promo message
            _sPara.Add("@Info5", taquoteresult.Info5); //is Repatriation unlimited
            _sPara.Add("@Info6", taquoteresult.Info6); //is Emergency tel actual cost

            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public void Delete(Int64 TAInsId)
        {
            MyDatabase _db = new MyDatabase();
            string _spName = "sprocTAQuoteResultDeleteSingleItem";

            SortedList _sPara = new SortedList();
            #region Parameter

            _sPara.Add("@TAInsId", TAInsId);
            #endregion

            _db.ExecuteSP(_spName, _sPara);

        }

        public TAQuoteResult GetTAQuoteResult(Int64 TAId, string CoverType)
        {
            TAQuoteResult _taquoteresult = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "sprocTAQuoteResultSelectSingleItem";

            SortedList _spara = new SortedList();
            _spara.Add("@TAInsID", TAId);
            _spara.Add("@CoverType", CoverType);

            using (DataTable _dt = _db.GetDataTableBySP(_spName, _spara))
            {
                if (_dt != null && _dt.Rows.Count > 0)
                {
                    _taquoteresult = new TAQuoteResult();
                    _taquoteresult = FillDataRecord(_dt, 0);
                }
            }
            return _taquoteresult;
        }

        public DataTable GetTAQuoteResultDT(Int64 TAId, string CoverType)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("Result");
            string _spName = "sprocTAQuoteResultSelectSingleItem";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@TAInsID", TAId);
            _sPara.Add("@CoverType", CoverType);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }

        public DataTable GetTAQuoteResultDisplay(string CoverType, string Duration, Int64 AreaId, Int64 CountryId, Int32 AdultAge, Int32 ChildAge,
            string CoverageLevel, string Trip, Int32 NoOfAdults)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("Result");
            string _spName = "sprocTAQuoteResultSelectItemList";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CoverType", CoverType);
            _sPara.Add("@Duration", Duration);
            _sPara.Add("@AreaId", AreaId);
            _sPara.Add("@CountryID", CountryId);
            _sPara.Add("@AdultAge", AdultAge);
            _sPara.Add("@ChildAge", ChildAge);
            _sPara.Add("@CoverageLevel", CoverageLevel);
            _sPara.Add("@TripType", Trip);
            _sPara.Add("@NoOfAdults", NoOfAdults);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }

        public DataTable GetTAQuoteResultDisplayByProvider(string CoverType, string Duration, Int64 AreaId, Int64 CountryId, Int32 AdultAge, Int32 ChildAge,
           string CoverageLevel, Int64 TACompanyID, Int32 NoOfAdults)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("Result");
            string _spName = "[sprocTAQuoteResultSelectItemListPerProvider]";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CoverType", CoverType);
            _sPara.Add("@Duration", Duration);
            _sPara.Add("@AreaId", AreaId);
            _sPara.Add("@CountryID", CountryId);
            _sPara.Add("@AdultAge", AdultAge);
            _sPara.Add("@ChildAge", ChildAge);
            _sPara.Add("@CoverageLevel", CoverageLevel);
            _sPara.Add("@ProviderCompanyID", TACompanyID);
            _sPara.Add("@NoOfAdults", NoOfAdults);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }

        public TAQuoteResult GetTASelectSingleItemSelected(Int64 TACompanyId, string CoverType)
        {
            TAQuoteResult _taquoteresult = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "sprocTAQuoteResultSelectSingleItemSelected";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", TACompanyId);
            _spara.Add("@CoverType", CoverType);

            using (DataTable _dt = _db.GetDataTableBySP(_spName, _spara))
            {
                if (_dt != null && _dt.Rows.Count > 0)
                {
                    _taquoteresult = new TAQuoteResult();
                    _taquoteresult = FillDataRecord(_dt, 0);
                }
            }
            return _taquoteresult;
        }

        public TAQuoteResult GetTASelectSingleItemSelected(Int64 TACompanyId, string CoverType, string CoverageLevel)
        {
            TAQuoteResult _taquoteresult = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "sprocTAQuoteResultSelectSingleItemSelected2";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", TACompanyId);
            _spara.Add("@CoverType", CoverType);
            _spara.Add("@CoverageLevel", CoverageLevel);

            using (DataTable _dt = _db.GetDataTableBySP(_spName, _spara))
            {
                if (_dt != null && _dt.Rows.Count > 0)
                {
                    _taquoteresult = new TAQuoteResult();
                    _taquoteresult = FillDataRecord(_dt, 0);
                }
            }
            return _taquoteresult;
        }

        public DataTable GetTASelectSingleItemSelectedDT(Int64 TACompanyId, string CoverType)
        {
            DataTable _dtResult = new DataTable("Result");
            MyDatabase _db = new MyDatabase();
            string _spName = "sprocTAQuoteResultSelectSingleItemSelected";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", TACompanyId);
            _spara.Add("@CoverType", CoverType);

            _dtResult = _db.GetDataTableBySP(_spName, _spara);

            return _dtResult;
        }

        private TAQuoteResult FillDataRecord(DataTable myDataTable, int rowId)
        {
            TAQuoteResult myTAQuoteResult = new TAQuoteResult();
            myTAQuoteResult.TAInsId = Convert.ToInt64(myDataTable.Rows[rowId]["TAInsID"].ToString());
            myTAQuoteResult.TACompanyId = Convert.ToInt64(myDataTable.Rows[rowId]["ProviderCompanyId"].ToString());
            myTAQuoteResult.PlanName = myDataTable.Rows[rowId]["PlanName"].ToString();
            myTAQuoteResult.PlanType = myDataTable.Rows[rowId]["PlanType"].ToString();
            myTAQuoteResult.TripType = myDataTable.Rows[rowId]["TripType"].ToString();
            myTAQuoteResult.CoverageLevel = myDataTable.Rows[rowId]["CoverageLevel"].ToString();
            myTAQuoteResult.AnnualPremium = Convert.ToSingle(myDataTable.Rows[rowId]["AnnualPremium"].ToString());
            myTAQuoteResult.DTPD_LessYr70 = Convert.ToInt32(myDataTable.Rows[rowId]["DTPD_LessYr70"].ToString());
            myTAQuoteResult.DTPD_AboveYr70 = Convert.ToInt32(myDataTable.Rows[rowId]["DTPD_AboveYr70"].ToString());
            myTAQuoteResult.DeathPubTrans = Convert.ToInt32(myDataTable.Rows[rowId]["DeathPubTrans"].ToString());

            if (myDataTable.Rows[rowId]["DIPC_LessYr70"].ToString() != "")
            {
                myTAQuoteResult.DIPC_LessYr70 = Convert.ToInt32(myDataTable.Rows[rowId]["DIPC_LessYr70"].ToString());
            }
            else
            {
                myTAQuoteResult.DIPC_LessYr70 = 0;
            }

            if (myDataTable.Rows[rowId]["DIPC_AboveYr70"].ToString() != "")
            {
                myTAQuoteResult.DIPC_AboveYr70 = Convert.ToInt32(myDataTable.Rows[rowId]["DIPC_AboveYr70"].ToString());
            }
            else
            {
                myTAQuoteResult.DIPC_AboveYr70 = 0;
            }

            myTAQuoteResult.Bereavement = Convert.ToInt32(myDataTable.Rows[rowId]["Bereavement"].ToString());
            myTAQuoteResult.MedExp_LessYr70 = Convert.ToInt32(myDataTable.Rows[rowId]["MedExp_LessYr70"].ToString());
            myTAQuoteResult.MedExp_AboveYr70 = Convert.ToInt32(myDataTable.Rows[rowId]["MedExp_AboveYr70"].ToString());
            myTAQuoteResult.EmMedEval = Convert.ToInt32(myDataTable.Rows[rowId]["EmMedEval"].ToString());
            myTAQuoteResult.HospIncome = Convert.ToInt32(myDataTable.Rows[rowId]["HospIncome"].ToString());
            myTAQuoteResult.BCR = Convert.ToInt32(myDataTable.Rows[rowId]["BCR"].ToString());
            myTAQuoteResult.CompassVisit = Convert.ToInt32(myDataTable.Rows[rowId]["CompassVisit"].ToString());
            myTAQuoteResult.ChildCare = Convert.ToInt32(myDataTable.Rows[rowId]["ChildCare"].ToString());
            myTAQuoteResult.PersonalLiability = Convert.ToInt32(myDataTable.Rows[rowId]["PersonalLiability"].ToString());
            myTAQuoteResult.LEWAD = Convert.ToInt32(myDataTable.Rows[rowId]["LEWAD"].ToString());
            myTAQuoteResult.BagPerEffect = Convert.ToInt32(myDataTable.Rows[rowId]["BagPerEffect"].ToString());
            myTAQuoteResult.BagDelay = Convert.ToInt32(myDataTable.Rows[rowId]["BagDelay"].ToString());
            myTAQuoteResult.TravelDoc = Convert.ToInt32(myDataTable.Rows[rowId]["TravelDoc"].ToString());
            myTAQuoteResult.DepositTripCancel = Convert.ToInt32(myDataTable.Rows[rowId]["DepositTripCancel"].ToString());
            myTAQuoteResult.Curtailment = Convert.ToInt32(myDataTable.Rows[rowId]["Curtailment"].ToString());
            myTAQuoteResult.TravelDelay = Convert.ToInt32(myDataTable.Rows[rowId]["TravelDelay"].ToString());
            myTAQuoteResult.MissTravelConnection = Convert.ToInt32(myDataTable.Rows[rowId]["MissTravelConnection"].ToString());
            myTAQuoteResult.TravelOverBook = Convert.ToInt32(myDataTable.Rows[rowId]["TravelOverBook"].ToString());
            myTAQuoteResult.PersonalMoney = Convert.ToInt32(myDataTable.Rows[rowId]["PersonalMoney"].ToString());
            myTAQuoteResult.CreditCardLost = Convert.ToInt32(myDataTable.Rows[rowId]["CreditCardLost"].ToString());
            myTAQuoteResult.FBHCP = Convert.ToInt32(myDataTable.Rows[rowId]["FBHCP"].ToString());
            myTAQuoteResult.ACRR = Convert.ToInt32(myDataTable.Rows[rowId]["ACRR"].ToString());
            myTAQuoteResult.Terrorism = Convert.ToInt32(myDataTable.Rows[rowId]["Terrorism"].ToString());
            myTAQuoteResult.KidnapHostage = Convert.ToInt32(myDataTable.Rows[rowId]["KidnapHostage"].ToString());
            myTAQuoteResult.EmtelCharge = Convert.ToInt32(myDataTable.Rows[rowId]["EmTelCharge"].ToString());
            myTAQuoteResult.DMPB = Convert.ToInt32(myDataTable.Rows[rowId]["DMPB"].ToString());
            myTAQuoteResult.Golfer = Convert.ToInt32(myDataTable.Rows[rowId]["Golfer"].ToString());
            myTAQuoteResult.Terrorism = Convert.ToInt32(myDataTable.Rows[rowId]["Terrorism"].ToString());
            myTAQuoteResult.Status = Convert.ToBoolean(myDataTable.Rows[rowId]["Status"].ToString());

            if (myDataTable.Rows[rowId]["Ninfo1"].ToString() != "")
                myTAQuoteResult.Ninfo1 = Convert.ToInt64(myDataTable.Rows[rowId]["Ninfo1"].ToString());
            else
                myTAQuoteResult.Ninfo1 = -1;

            if (myDataTable.Rows[rowId]["Ninfo2"].ToString() != "")
                myTAQuoteResult.Ninfo2 = Convert.ToInt64(myDataTable.Rows[rowId]["Ninfo2"].ToString());
            else
                myTAQuoteResult.Ninfo2 = -1;

            if (myDataTable.Rows[rowId]["Ninfo3"].ToString() != "")
                myTAQuoteResult.Ninfo3 = Convert.ToInt64(myDataTable.Rows[rowId]["Ninfo3"].ToString());
            else
                myTAQuoteResult.Ninfo3 = 0;

            if (myDataTable.Rows[rowId]["Ninfo4"].ToString() != "")
                myTAQuoteResult.Ninfo4 = Convert.ToInt64(myDataTable.Rows[rowId]["Ninfo4"].ToString());
            else
                myTAQuoteResult.Ninfo4 = 0;

            if (myDataTable.Rows[rowId]["Ninfo5"].ToString() != "")
                myTAQuoteResult.Ninfo5 = Convert.ToInt32(myDataTable.Rows[rowId]["Ninfo5"].ToString());
            else
                myTAQuoteResult.Ninfo5 = 0;

            if (myDataTable.Rows[rowId]["Ninfo6"].ToString() != "")
                myTAQuoteResult.Ninfo6 = Convert.ToInt32(myDataTable.Rows[rowId]["Ninfo6"].ToString());
            else
                myTAQuoteResult.Ninfo6 = 0;

            if (myDataTable.Rows[rowId]["Ninfo7"].ToString() != "")
                myTAQuoteResult.Ninfo7 = Convert.ToInt32(myDataTable.Rows[rowId]["Ninfo7"].ToString());
            else
                myTAQuoteResult.Ninfo7 = 0;

            if (myDataTable.Rows[rowId]["Ninfo8"].ToString() != "")
                myTAQuoteResult.Ninfo8 = Convert.ToInt32(myDataTable.Rows[rowId]["Ninfo8"].ToString());
            else
                myTAQuoteResult.Ninfo8 = 0;


            if (myDataTable.Rows[rowId]["Info1"].ToString() != "")
                myTAQuoteResult.Info1 = myDataTable.Rows[rowId]["Info1"].ToString();
            else
                myTAQuoteResult.Info1 = "";

            if (myDataTable.Rows[rowId]["Info2"].ToString() != "")
                myTAQuoteResult.Info2 = myDataTable.Rows[rowId]["Info2"].ToString();
            else
                myTAQuoteResult.Info2 = "";

            if (myDataTable.Rows[rowId]["Info3"].ToString() != "")
                myTAQuoteResult.Info3 = myDataTable.Rows[rowId]["Info3"].ToString();
            else
                myTAQuoteResult.Info3 = "";

            if (myDataTable.Rows[rowId]["Info4"].ToString() != "")
                myTAQuoteResult.Info4 = myDataTable.Rows[rowId]["Info4"].ToString();
            else
                myTAQuoteResult.Info4 = "";

            if (myDataTable.Rows[rowId]["Info5"].ToString() != "")
                myTAQuoteResult.Info5 = myDataTable.Rows[rowId]["Info5"].ToString();
            else
                myTAQuoteResult.Info5 = "";

            if (myDataTable.Rows[rowId]["Info6"].ToString() != "")
                myTAQuoteResult.Info6 = myDataTable.Rows[rowId]["Info6"].ToString();
            else
                myTAQuoteResult.Info6 = "";


            return myTAQuoteResult;
        }

        public DataSet GetTAPlanDetailsHSBC(Int64 ProviderCompanyId, Int64 TAInsId, Int64 CountryId, Int64 TAAppSeaId)
        {
            DataSet _taplandetailshsbc = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocTAPlanDetailsSelectSingleItem_HSBC]";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", ProviderCompanyId);
            _spara.Add("@TAInsId", TAInsId);
            _spara.Add("@CountryId", CountryId);
            _spara.Add("@TAAppSeaId", TAAppSeaId);

            using (DataSet _ds = _db.GetDataSet(_spName, _spara))
            {
                if (_ds != null && _ds.Tables[0].Rows.Count > 0)
                {
                    _taplandetailshsbc = _ds;
                }
            }
            return _taplandetailshsbc;
        }

        //Sakthi 0n 30 Dec 2010 -- Start

        public DataTable GetTAQuoteResultDisplay(string CoverType, string Duration, Int64 AreaId, Int64 CountryId, Int32 AdultAge, Int32 ChildAge,
            string CoverageLevel, string Trip, Int32 NoOfAdults, Int32 NoOfChilds, Int64 TAId)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("Result");
            string _spName = "sprocTAResultSelectItemList";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CoverType", CoverType);
            _sPara.Add("@Duration", Duration);
            _sPara.Add("@AreaId", AreaId);
            _sPara.Add("@CountryID", CountryId);
            _sPara.Add("@AdultAge", AdultAge);
            _sPara.Add("@ChildAge", ChildAge);
            _sPara.Add("@CoverageLevel", CoverageLevel);
            _sPara.Add("@TripType", Trip);
            _sPara.Add("@NoOfAdults", NoOfAdults);
            _sPara.Add("@NoOfChilds", NoOfChilds);
            _sPara.Add("@TAId", TAId);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }

        public DataTable GetTAQuoteResultDisplayByProvider(string CoverType, string Duration, Int64 AreaId, Int64 CountryId, Int32 AdultAge, Int32 ChildAge,
           string CoverageLevel, Int64 TACompanyID, Int32 NoOfAdults, Int32 NoOfChilds, Int64 TAId)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("Result");
            string _spName = "[sprocTAResultSelectItemListPerProvider]";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CoverType", CoverType);
            _sPara.Add("@Duration", Duration);
            _sPara.Add("@AreaId", AreaId);
            _sPara.Add("@CountryID", CountryId);
            _sPara.Add("@AdultAge", AdultAge);
            _sPara.Add("@ChildAge", ChildAge);
            _sPara.Add("@CoverageLevel", CoverageLevel);
            _sPara.Add("@ProviderCompanyID", TACompanyID);
            _sPara.Add("@NoOfAdults", NoOfAdults);
            _sPara.Add("@NoOfChilds", NoOfChilds);
            _sPara.Add("@TAId", TAId);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }

        //Sakthi 0n 30 Dec 2010 -- End

        //Cheryl 0n 18 Aug 2011 -- Start
        public DataTable GetTAQuoteResultDisplayWithPromo(string CoverType, string Duration, Int64 AreaId, Int64 CountryId, Int32 AdultAge, Int32 ChildAge,
            string CoverageLevel, string Trip, Int32 NoOfAdults, Int32 NoOfChilds, Int64 TAId)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("Result");
            string _spName = "sprocTAResultSelectItemListWithPromo";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CoverType", CoverType);
            _sPara.Add("@Duration", Duration);
            _sPara.Add("@AreaId", AreaId);
            _sPara.Add("@CountryID", CountryId);
            _sPara.Add("@AdultAge", AdultAge);
            _sPara.Add("@ChildAge", ChildAge);
            _sPara.Add("@CoverageLevel", CoverageLevel);
            _sPara.Add("@TripType", Trip);
            _sPara.Add("@NoOfAdults", NoOfAdults);
            _sPara.Add("@NoOfChilds", NoOfChilds);
            _sPara.Add("@TAId", TAId);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }

        public DataTable GetTAQuoteResultDisplayByProviderWithPromo(string CoverType, string Duration, Int64 AreaId, Int64 CountryId, Int32 AdultAge, Int32 ChildAge,
           string CoverageLevel, Int64 TACompanyID, Int32 NoOfAdults, Int32 NoOfChilds, Int64 TAId)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("Result");
            string _spName = "[sprocTAResultSelectItemListPerProviderWithPromo]";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CoverType", CoverType);
            _sPara.Add("@Duration", Duration);
            _sPara.Add("@AreaId", AreaId);
            _sPara.Add("@CountryID", CountryId);
            _sPara.Add("@AdultAge", AdultAge);
            _sPara.Add("@ChildAge", ChildAge);
            _sPara.Add("@CoverageLevel", CoverageLevel);
            _sPara.Add("@ProviderCompanyID", TACompanyID);
            _sPara.Add("@NoOfAdults", NoOfAdults);
            _sPara.Add("@NoOfChilds", NoOfChilds);
            _sPara.Add("@TAId", TAId);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }

        //Cheryl 0n 18 Aug 2011 -- End

        //Sakthi 0n 05 Jan 2011 -- Start
        public DataSet GetTAPlanDetailsDA(Int64 ProviderCompanyId, Int64 TAInsId, Int64 CountryId, Int64 TAAppSeaId)
        {
            DataSet _taplandetailshsbc = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocTAPlanDetailsSelectSingleItem_DA]";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", ProviderCompanyId);
            _spara.Add("@TAInsId", TAInsId);
            _spara.Add("@CountryId", CountryId);
            _spara.Add("@TAAppSeaId", TAAppSeaId);

            using (DataSet _ds = _db.GetDataSet(_spName, _spara))
            {
                if (_ds != null && _ds.Tables[0].Rows.Count > 0)
                {
                    _taplandetailshsbc = _ds;
                }
            }
            return _taplandetailshsbc;
        }
        //Sakthi 0n 05 Jan 2011 -- End

        //Sakthi 0n 06 Jan 2011 -- Start
        public DataSet GetTAPlanDetails1Cover(Int64 ProviderCompanyId, Int64 TAInsId, Int64 CountryId, Int64 TAAppSeaId)
        {
            DataSet _taplandetailshsbc = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocTAPlanDetailsSelectSingleItem_1Cover]";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", ProviderCompanyId);
            _spara.Add("@TAInsId", TAInsId);
            _spara.Add("@CountryId", CountryId);
            _spara.Add("@TAAppSeaId", TAAppSeaId);

            using (DataSet _ds = _db.GetDataSet(_spName, _spara))
            {
                if (_ds != null && _ds.Tables[0].Rows.Count > 0)
                {
                    _taplandetailshsbc = _ds;
                }
            }
            return _taplandetailshsbc;
        }
        //Sakthi 0n 06 Jan 2011 -- End

        //Che 0n 02 June 2011 -- Start
        public DataSet GetTAPlanDetailsChinaTaiping(Int64 ProviderCompanyId, Int64 TAInsId, Int64 CountryId, Int64 TAAppSeaId)
        {
            DataSet _taplandetailshsbc = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocTAPlanDetailsSelectSingleItem_ChinaTaiping]";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", ProviderCompanyId);
            _spara.Add("@TAInsId", TAInsId);
            _spara.Add("@CountryId", CountryId);
            _spara.Add("@TAAppSeaId", TAAppSeaId);

            using (DataSet _ds = _db.GetDataSet(_spName, _spara))
            {
                if (_ds != null && _ds.Tables[0].Rows.Count > 0)
                {
                    _taplandetailshsbc = _ds;
                }
            }
            return _taplandetailshsbc;
        }
        //Che 0n 02 June 2011 -- End

        //Che 0n 21 May 2012 -- Start
        public DataSet GetTAPlanDetailsRSA(Int64 ProviderCompanyId, Int64 TAInsId, Int64 CountryId, Int64 TAAppSeaId)
        {
            DataSet _taplandetailshsbc = null;
            MyDatabase _db = new MyDatabase();
            string _spName = "[sprocTAPlanDetailsSelectSingleItem_RSA]";

            SortedList _spara = new SortedList();
            _spara.Add("@ProviderCompanyId", ProviderCompanyId);
            _spara.Add("@TAInsId", TAInsId);
            _spara.Add("@CountryId", CountryId);
            _spara.Add("@TAAppSeaId", TAAppSeaId);

            using (DataSet _ds = _db.GetDataSet(_spName, _spara))
            {
                if (_ds != null && _ds.Tables[0].Rows.Count > 0)
                {
                    _taplandetailshsbc = _ds;
                }
            }
            return _taplandetailshsbc;
        }
        //Che 0n 21 May 2012 -- End
    }
}